
package com.bstek.urule.parse.deserializer;

import com.bstek.urule.model.library.variable.VariableCategory;
import com.bstek.urule.parse.VariableLibraryParser;
import org.dom4j.Element;

import java.util.List;


/**
 * @author Jacky.gao
 * @since 2014年12月23日
 */
public class VariableLibraryDeserializer implements Deserializer<List<VariableCategory>> {
    public static final String BEAN_ID = "urule.variableLibraryDeserializer";
    private VariableLibraryParser variableLibraryParser;

    public List<VariableCategory> deserialize(Element root) {
        return variableLibraryParser.parse(root);
    }

    public boolean support(Element root) {
        if (variableLibraryParser.support(root.getName())) {
            return true;
        } else {
            return false;
        }
    }

    public void setVariableLibraryParser(VariableLibraryParser variableLibraryParser) {
        this.variableLibraryParser = variableLibraryParser;
    }
}
